<template>
  <el-card>
    <el-tabs v-model="activeName">
      <el-tab-pane label="功能介绍"
                   name="first">
        <el-collapse v-model="activeCollapse"
                     accordion>
          <el-collapse-item v-for="item in featureData"
                            :key="item.id"
                            :name="item.id"
                            :title="item.title">
            <div v-html="item.content"> </div>
          </el-collapse-item>
        </el-collapse>
      </el-tab-pane>
      <el-tab-pane label="作者"
                   name="second">
        <div class="author-container">
          <div class="header">
            <el-avatar :src="avatarSrc"
                       :size="60"
                       class="avatar">

            </el-avatar>
            <div class="header-desc">
              <h3>董兴震</h3>
              <span>男，山东农业大学 2021级 计算机科学与技术专业 在读本科生</span>
            </div>

          </div>
          <ul class="info">
            <li>曾获2021-2022年 山东农业大学三等奖学金。</li>
            <li>前端方面：掌握 HTML、CSS、JavaScript，能够熟练使用 Vue，并结合 ElementUI 进行开发。</li>
            <li>后端方面：熟悉Java编程语言，熟悉JavaWeb框架，了解Node.js，熟悉MySQL、编写SQL语句，
              熟悉Linux基本操作。</li>
          </ul>
        </div>
      </el-tab-pane>
    </el-tabs>
  </el-card>
</template>

<script setup>
import { avatar, getAvatar } from '@/hooks/getAvatar'
import { ref, defineProps } from 'vue'

const { avatarSrc } = getAvatar();
const props = defineProps(['featureData']);
const activeName = ref('first');
const activeCollapse = ref(1);
</script>

<style lang="scss" scoped>
:deep(.el-collapse-item__header) {
  font-weight: bold;
}
.el-collapse-item {
  :deep(a) {
    color: #409eff;
    margin: 0 4px;
  }
}
.author-container {
  .header {
    display: flex;
    .avatar {
      width: 60px;
      height: 60px;
      border-radius: 50%;
    }
    .header-desc {
      margin-left: 12px;
      display: flex;
      flex-direction: column;
      justify-content: space-around;

      span {
        font-size: 14px;
      }
    }
  }
  .info > li {
    margin-top: 16px;
    line-height: 22px;
    font-size: 14px;
    text-indent: 26px;
  }
}
</style>
